package com.shxzz.easy12306.framework.starter.base.config;

import com.shxzz.easy12306.framework.starter.base.ApplicationContextHolder;
import com.shxzz.easy12306.framework.starter.base.init.ApplicationReadyPostProcessor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

/**
 * 应用基础配置自动装配
 * @author shxzz
 * @create 2024-02-20-19:01
 */
public class ApplicationBaseAutoConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public ApplicationContextHolder applicationContextHolder() {
        return new ApplicationContextHolder();
    }

    @Bean
    @ConditionalOnMissingBean
    public ApplicationReadyPostProcessor applicationReadyPostProcessor(ApplicationContext applicationContext) {
        return new ApplicationReadyPostProcessor(applicationContext);
    }
}
